package com.zhijiaoyun.service;

import com.zhijiaoyun.model.Admin;
import com.zhijiaoyun.model.dto.PageList;
import com.zhijiaoyun.service.core.IBaseService;

import java.util.Map;

/**
 * @author shisfish
 * @date 2017/6/6
 */
public interface IAdminService extends IBaseService<Admin> {

    /**
     * get admin by accnt
     *
     * @param account
     * @return
     */
    Admin getAdminByAccount(String account);

    /**
     * page by params
     *
     * @param pageIndex
     * @param pageSize
     * @param account
     * @param username
     * @param status
     * @return
     */
    PageList<Admin> pageByParams(int pageIndex, int pageSize, String account, String username, int status);

    /**
     * is allowed
     *
     * @param adminId
     * @param authorityId
     * @return
     */
    boolean isAllowed(long adminId, long authorityId);

    /**
     * 新增管理员
     *
     * @param account
     * @param username
     * @param password
     * @param authorityId
     * @param status
     * @param createUser
     * @return
     */
    Map<String, Object> addAdmin(String account, String username, String password, Long authorityId, Integer status, String createUser);

    /**
     * get by id
     *
     * @param adminId
     * @return
     */
    Map<String, Object> getAdminById(long adminId);

    /**
     * page
     *
     * @param pageIndex
     * @param pageSize
     * @param account
     * @param username
     * @param status
     * @return
     */
    Map<String, Object> page(int pageIndex, int pageSize, String account, String username, Integer status);
}
